package com.company.jvm.StringTest;

/**
 * @ClassName MyCircularQueue
 * @Description TODO
 * @Author ylr
 * @Date 2021/8/10 23:09
 * @Version 1.0
 */
public class Maintest {
    private String str = "test";
    private char[] ch = {'a', 'b', 'c'};

    static {
        System.out.println("hello Static");
    }

    public Maintest(){
        System.out.println("hello");
    }


    public static void main(String[] args) {
        Maintest maintest = new Maintest();
        maintest.change(maintest.str,maintest.ch);
        System.out.println(maintest.str);
        System.out.println("---------------");
        System.out.println(maintest.ch);


        System.out.println("-----------------------------------");
        String s2 = "123";
        String s = new String("123");
        s.intern();
        String s1 = new String("123");

        if (s==s1||s.intern()==s2){
            System.out.println("1   s==s1");
        }
        if (s.equals(s1)&&s.equals(s2)){
            System.out.println("2   s==s1");
        }
    }

    public void change(String str,char[] ch ){

        str = "gogogo";
        ch[0] = 'p';

    }


}
